package com.cssw.fyzb.busi.api.live;

import com.cssw.fyzb.busi.service.live.AnchorService;
import com.cssw.fyzb.busi.service.live.LiveService;
import com.cssw.fyzb.core.model.dodb.CmfLiveKickOut;
import com.cssw.fyzb.core.model.dodb.CmfLiveMute;
import com.ydn.appserver.Action;
import com.ydn.appserver.Request;
import com.ydn.appserver.Response;
import com.ydn.appserver.annotations.Function;
import com.ydn.appserver.annotations.Parameter;
import com.ydn.appserver.annotations.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 举报
 * @author wondream
 */
@Function(description = "举报", parameters = {
        @Parameter(name = "liveId", type = Type.String, description = "直播ID", required = true),
        @Parameter(name = "fromUserId", type = Type.String, description = "举报用户标识", required = true),
        @Parameter(name = "toUserId", type = Type.String, description = "被举报用户", required = true),
        @Parameter(name = "content", type = Type.String, description = "内容", required = false)
})
@Component
public class AddLiveReport implements Action {

    @Autowired
    LiveService liveService;

    @Override
    public Response execute(Request request) throws Exception {
        Long liveId = request.getLong("liveId");
        Long fromUserId = request.getLong("fromUserId");
        Long toUserId = request.getLong("toUserId");
        String content = request.getString("content");
        liveService.addLiveReport(liveId, fromUserId, toUserId, content);
        return Response.success("操作成功");
    }
}



